package com.blueocean_health.care.management.controller;

import java.util.Map;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.blueocean_health.care.management.common.LocalManager;
import com.blueocean_health.care.management.domain.base.SysResult;
import com.blueocean_health.care.management.domain.base.User;
import com.blueocean_health.care.management.domain.dto.TeamPayDto;
import com.blueocean_health.care.management.domain.vo.TeamPayVo;
import com.blueocean_health.care.management.em.LocalManagerType;
import com.blueocean_health.care.management.service.HospitalService;
import com.blueocean_health.care.management.service.ITeamService;

/**
 * 医院模块 接口 2017年8月22日17:09:00
 * @author wuyanli
 *
 */

@RestController
@RequestMapping("web/hospital")
public class TeamController {
	
	@Resource
	private HospitalService hospitalService;
	/**
	 * 修改医院资费信息
	 * @param hospitalId
	 * @return
	 */
	@Resource
	private ITeamService teamService;
	
	@RequestMapping(value = "changeworkerpay")
	public SysResult changeHosipital(@RequestBody TeamPayDto teamPayDto) {
		User user = LocalManager.getVal(LocalManagerType.USER_WEB);
		teamPayDto.setTeamId(user.getHospitalId());
		Boolean changeHosipital = teamService.changeHosipital(teamPayDto);
		return SysResult.ok(changeHosipital);
		
	}
	@RequestMapping(value = "selecthospitalworkerpay")
	public SysResult selecthospitalworkerpay() {
		User user = LocalManager.getVal(LocalManagerType.USER_WEB);
		String hospitalId = user.getHospitalId();
		 TeamPayVo selecthospitalworkerpay = teamService.selecthospitalworkerpay(hospitalId);
		return SysResult.ok(selecthospitalworkerpay);
		
	}
	
}
